/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package jjrealestatevisitor;

import jjrealestatevisitor.structure.*;
import java.util.Iterator;

/**
 *
 * @author jochemsiegel
 */
public class HouseSpecIterator {
    HouseSpecifications hsfc;
    House house;


    public void iterateThroughHouses(HouseSpecifications hsfc, House house) {
        this.hsfc = hsfc;
        this.house = house;
        house.accept(hsfc);
        for (Iterator it = house.getRooms().iterator(); it.hasNext();) {
            Room room1 = ((Room) it.next());
            room1.accept(hsfc);
            for (Iterator it2 =  room1.getRoomItems().iterator(); it2.hasNext();) {
                ((RoomItem) it2.next()).accept(hsfc);
            }
        }

    }

}
